# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Maxime Arthaud <maxime@arthaud.me>

pkgname=zxing-cpp
pkgver=git20180320
pkgrel=2
_commit=5aad4744a3763d814df98a18886979893e638274
pkgdesc="A command-line tool to decode QRCode"
arch=(x86_64)
url="https://github.com/glassechidna/zxing-cpp"
license=(Apache)
depends=(gcc-libs)
makedepends=(git cmake opencv gtk3)
optdepends=('opencv: support for opencv')
source=("$pkgname::git+https://github.com/glassechidna/zxing-cpp.git#commit=$_commit")
sha512sums=('SKIP')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../$pkgname \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_CXX_FLAGS="${CXXFLAGS} -fPIC"
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
